﻿using Alos.Entity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;


namespace Alos.LanClass.Api
{
    /// <summary>
    /// 
    /// </summary>
    public class WebConfigController : ApiController
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("api/Webconfig/GetWebConfigValue")]
        public JsonRtn<dynamic> GetWebConfigValue() 
        {
            var jsRtn = new JsonRtn<dynamic>();
            jsRtn.data = new {
                StudentPath = ConfigurationManager.AppSettings["StudentPath"],
                ServerIP = ConfigurationManager.AppSettings["ServerIP"],
                FileUrl = ConfigurationManager.AppSettings["FileUrl"],
                TeacherRecord = ConfigurationManager.AppSettings["TeacherRecord"],
                TeacherControlPath = ConfigurationManager.AppSettings["TeacherControlPath"],
                CloudSystem = ConfigurationManager.AppSettings["CloudSystem"],
                BaseDirectory = ConfigurationManager.AppSettings["BaseDirectory"]
            };
            if (jsRtn.data==null)
            {
                jsRtn.state = RtnState.error;
                jsRtn.message = "获取失败";
            }
            else
            {
                jsRtn.state = RtnState.sucess;
                jsRtn.message = "获取成功";
            }
            return jsRtn;
        }
    }
}